N=int(raw_input())
A=map(float, raw_input().split(' '))

s=0
for i in range(len(A)):
    tmp = len(A)-1 - i if len(A)/2 <= i else i
    ts = 0
    ts=(1+tmp)*tmp/2
    ts*=2
    ts+=(1+tmp)*(N-tmp*2)
    s+=ts*A[i]

print '%.2f'%s